import API from '../../utils/api'
import common from '../../utils/common'
Page({

  /**
   * 页面的初始数据
   */
  data: {
    personInfo:{},
    activeList:[]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    
  },
  onShow: function () {
    this.minePageData()
  },
  minePageData () {
    API.minePage({}).then(res=>{
      if (res.code == 0) {
        var active = res.data.active
        for (var k in active) {
          active[k].startime = common.dateFormat(active[k].startime,1)
        }
        wx.setStorageSync('myIntrduce', res.data.personInfo.introduce )
        this.setData({
          personInfo:res.data.personInfo,
          activeList:active
        })
      }
    })
  },
  toActivityDetail (e) {
    var id = e.currentTarget.dataset.id
    wx.navigateTo({
      url: '/pages/activityDetail/activityDetail?id=' + id
    })
  }


})